<?php
namespace Admin\Model;
use Think\Model\RelationModel;
	class RoomModel extends RelationModel{ 
		
		protected $_auto=array(
			array('created_at','time',1,'function'),
			array('is_stay','0'),
			array('status','0'),
		);

		protected $_link=array(
		
			'Roomcate'=> array(  
     			'mapping_type'=>self::BELONGS_TO,
          		'class_name'=>'Article',
          		'foreign_key'=>'roomcate',
				'mapping_name'=>'roomcate',
				'mapping_fields'=>'title',
				'as_fields'=>'title',
			),
			
		);

		
		 protected $_validate = array(
		     array('roomno','','此房号已经存在！',0,'unique',3), // 在新增的时候验证name字段是否唯一
		 );
	}
?>
